﻿using System;
using System.ComponentModel;

namespace LeoK.DCI.Entity
{
    public class DayPoint : IComparable, INotifyPropertyChanged
    {
        private double _value;
        public double Value 
        {
            get { return _value; }
            set
            {
                _value = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Value"));
                }
            }
        }

        public DateTime Time { get; set; }
        public string Note { get; set; }
        
        public int CompareTo(object obj)
        {
            DayPoint point = obj as DayPoint;
            if (point.Time == Time)
            {
                return 0;
            }
            else
            {
                return Time > point.Time ? 1 : -1;
            }
        }

        public DayPoint()
        {
            Note = "";
        }

        public event PropertyChangedEventHandler PropertyChanged;
    }
}
